package com.interview.item.javabase.classDemo.one;

/**
 * @Author:zxh
 * @Description: java类protected权限访问修饰符演示
 * @Date: 2020/3/23
 * @Modified By:
 */
public  class one {
    private String str;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof one)) return false;

        one one = (one) o;

        return str.equals(one.str);
    }

    @Override
    public int hashCode() {
        return str.hashCode();
    }

    @Override
    public String toString() {
        return "one{" +
                "str='" + str + '\'' +
                '}';
    }

    /**
      * @Author:zxh
      * @Description: protected：受保护的，相同包，不同包子类，可访问
      * @Date: 2020/3/23
      */
    protected final static void modifier(String string,int num){

    }

    public one() {
    }

    /**
      * @Author:zxh
      * @Description:  throw 抛出异常对象，throws抛出异常
      * @Date: 2020/3/23
      */

    public void oneA() throws Exception{
        throw new RuntimeException();
    }
}
